FROM eclipse-temurin:8-jdk
# 指定工作目录
WORKDIR /app
#添加时区环境变量
ENV TZ Asia/Shanghai
#修改apt使用国内源
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
#为镜像设置时区和字体包
RUN apt-get update \
    && apt-get install -y fonts-dejavu \
    && cp /usr/share/zoneinfo/${TZ} /etc/localtime \
    && echo ${TZ} > /etc/timezone

#将打包好的jar包封装进镜像
# 设置参数
ARG JAR_NAME=script
# 复制文件
COPY ${JAR_NAME}.jar app.jar
# 运行端口
EXPOSE 8091
#镜像运行命令
ENTRYPOINT [ "java", "-jar", "app.jar" ]
#ENV LOG4J_CONTEXT_SELECTOR org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
